import request from '@/config/axios'

// 座位预定信息 VO
export interface SeatReserveVO {
  reserveStatus: number // 预定状态
  signTime: Date // 签到时间
  id: number // 预定ID
  officeId: number // 办公室ID
  reserveTime: string // 预定时间段
  cancelUserid: number // 取消用户ID
  cancelTime: Date // 取消时间
  isSign: number // 是否签到
  reserverUsername: string // 预定用户
  cancelUsername: string // 取消人姓名
  seatId: number // 座位id
  reserverUserid: number // 预定用户ID
  reserveDate: Date // 预定日期
}

// 座位预定信息 API
export const SeatReserveApi = {
  // 查询座位预定信息分页
  getSeatReservePage: async (params: any) => {
    return await request.get({ url: `/system/seat-reserve/page`, params })
  },

  // 查询座位预定信息详情
  getSeatReserve: async (id: number) => {
    return await request.get({ url: `/system/seat-reserve/get?id=` + id })
  },

  // 新增座位预定信息
  createSeatReserve: async (data: SeatReserveVO) => {
    return await request.post({ url: `/system/seat-reserve/create`, data })
  },

  // 修改座位预定信息
  updateSeatReserve: async (data: SeatReserveVO) => {
    return await request.put({ url: `/system/seat-reserve/update`, data })
  },

  // 删除座位预定信息
  deleteSeatReserve: async (id: number) => {
    return await request.delete({ url: `/system/seat-reserve/delete?id=` + id })
  },

  // 导出座位预定信息 Excel
  exportSeatReserve: async (params) => {
    return await request.download({ url: `/system/seat-reserve/export-excel`, params })
  }
}